package transactions;

import java.sql.Timestamp;

public class BankStatement implements Comparable<BankStatement> {

	// map of lists
	// Maps sind key.value pairs von playername,BankStatement Objekten

	// sortiere nach aktientyp, Zeit

	private String playerName;
	private String ShareName;
	private static final String SOLD = "sold";
	private static final String BOUGHT = "bought";
	private int count; // wieviele wurden gekauft ?
	private float course; // zu welchem Kurs ?
	private String soldOrBought;
	private java.sql.Timestamp tstamp;

	public BankStatement(String pName, String sName, boolean sold, int count,
			float course, java.sql.Timestamp timestamp) {

		if (sold)
			this.soldOrBought = SOLD;
		else
			this.soldOrBought = BOUGHT;

		this.playerName = pName;
		this.ShareName = sName;
		this.count = count;
		this.course = course;
		this.tstamp = timestamp;
	}



	@Override
	public String toString() {

		return this.playerName + " " + this.soldOrBought + " " + this.count
				+ " " + this.ShareName + " for " + this.course + " each\n";

	}
	
	public Timestamp getTimeStamp () {
		return this.tstamp;
	}
	
	public String getShareName() {
		return this.ShareName;
	}

	@Override
	public int compareTo(BankStatement o) {
		return this.ShareName.compareTo(o.ShareName);
	}

}
